import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.http.HttpEntity;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;



public class Mytest {
	
	public static void main(String[] args) {
		get();
	}
	
    /** 
     * 发送 get请求 
     */  
    public static void get() {  
    	Pattern pattern = Pattern.compile("1\\d{10}");
        try(CloseableHttpClient httpclient = HttpClients.createDefault()) {  
        	for(int i = 1; i <= 2; i++){
        		HttpGet httpget = new HttpGet("http://www.kidsyn.com/admin/user/list?pageNumber="+i+"&type=2");
        		httpget.addHeader("Cookie", "JSESSIONID=B3A6D5CE99108739448760573880F554");
        		try(CloseableHttpResponse response = httpclient.execute(httpget)) {  
        			HttpEntity entity = response.getEntity();  
        			String str = EntityUtils.toString(entity);
        			Matcher matcher = pattern.matcher(str);
        			while(matcher.find()){
        				System.out.println(matcher.group());
        			}
        		}
        	}
        } catch (ClientProtocolException e) {  
            e.printStackTrace();  
        } catch (IOException e) {  
            e.printStackTrace();  
        }
    }
}
